/*
 * Copyright (C) 2009 Chang Min Lee <ch5ngmn@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. (/COPYING)
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

// -*- C++ -*-
//
// $Id$

// ****  Code generated by the The ACE ORB (TAO) IDL Compiler v1.7 ****
// TAO and the TAO IDL Compiler have been developed by:
//       Center for Distributed Object Computing
//       Washington University
//       St. Louis, MO
//       USA
//       http://www.cs.wustl.edu/~schmidt/doc-center.html
// and
//       Distributed Object Computing Laboratory
//       University of California at Irvine
//       Irvine, CA
//       USA
//       http://doc.ece.uci.edu/
// and
//       Institute for Software Integrated Systems
//       Vanderbilt University
//       Nashville, TN
//       USA
//       http://www.isis.vanderbilt.edu/
//
// Information about TAO is available at:
//     http://www.cs.wustl.edu/~schmidt/TAO.html

// TAO_IDL - Generated from 
// .\be\be_codegen.cpp:1140

#ifndef SESSION_I_H_
#define SESSION_I_H_

#include "SessionS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

class IoEventHandler;
class  Taonet_CallbackClient_i
  : public virtual POA_Taonet::CallbackClient
{
public:
  // Constructor 
  Taonet_CallbackClient_i (IoEventHandler *handler);
  
  // Destructor 
  virtual ~Taonet_CallbackClient_i (void);
  
  virtual
  void process (
      const ::Taonet::ByteSeq & msg);

private:
	IoEventHandler *handler_;
};

class IoSessionManager;
class  Taonet_Session_i
  : public virtual POA_Taonet::Session
{
public:
  // Constructor 
  Taonet_Session_i (IoSessionManager *manager);
  
  // Destructor 
  virtual ~Taonet_Session_i (void);

  virtual
  ::CORBA::ULong login (
      ::Taonet::CallbackClient_ptr cb);
  
  virtual
  void logout (
      void);
  
  virtual
  void process (
      const ::Taonet::ByteSeq & msg);

	const Taonet::CallbackClient_ptr callback() { return callback_.in(); }
	


	void key(ACE_UINT32 key) { key_ = key; }
	ACE_UINT32 key (void) { return key_; }

	bool is_activated() { return !dispose_; }
private:

	void dispose (bool dispose) { dispose_ = dispose; }
	IoSessionManager *manager_;
	Taonet::CallbackClient_var callback_;
	bool dispose_;
	ACE_UINT32 key_;

};

class  Taonet_SessionAdmin_i
  : public virtual POA_Taonet::SessionAdmin
{
public:
  // Constructor 
  Taonet_SessionAdmin_i (IoSessionManager *manager);
  
  // Destructor 
  virtual ~Taonet_SessionAdmin_i (void);
  
  virtual
  ::Taonet::Session_ptr create (
      const char * id);
  
  virtual
  ::CORBA::UShort max_capacity (
      void);
  
  virtual
  ::CORBA::UShort current_size (
      void);

	void poa(PortableServer::POA_ptr poa) { poa_ = PortableServer::POA::_duplicate (poa); }
private:
	PortableServer::POA_ptr poa_;
	IoSessionManager *manager_;
};


#endif /* SESSION_I_H_  */

